import request from '@/config/axios'

// 员工列表
export const getPersonnelList = (data) => {
  return request.get({
    url: '/service/employee/page',
    params: data
  })
}

// 修改劳务员工状态
export const updatePersonnelStatus = (data) => {
  return request.post({
    url: '/service/employee/update-status',
    params: data
  })
}

// 获取员工详情信息
export const getPersonnelDetail = (id) => {
  return request.get({
    url: '/service/employee/get',
    params: { id }
  })
}

// 新增员工
export const addPersonnel = (data) => {
  return request.post({
    url: '/service/employee/create',
    data,
  })
}

// 编辑员工
export const editPersonnel = (data) => {
  return request.put({
    url: '/service/employee/update',
    data,
  })
}

// 删除员工
export const deletePersonnel = (id) => {
  return request.delete({
    url: '/service/employee/delete',
    params: { id }
  })
}

// 批量删除
export const batchdDelPersonne = (data) => {
  return request.delete({
    url: '/service/employee/delete-list',
    data
  })
}


// 手机号查询人员
export const getPersonnelByPhone = (phone) => {
  return request.get({
    url: '/service/employee/get-by-phone',
    params: { phone }
  })
}

// 导出
export const exportPersonnel = (data) => {
  return request.download({
    url: '/service/employee/export-excel',
    params: data,
  })
}